import QtQuick 2.10
import QtQuick.Controls 2.10
import QtQuick.Window 2.0

Window {
    id: root
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    property int areaWidth: 20
    MouseArea{
        anchors.fill: parent
        onClicked: {
            console.log("Window Clicked");
            info.text = "Window Clicked"
        }
        onPressed:{
            console.log("Window onPressed");
            info.text = ""
        }
        onReleased: {
            console.log("Window onReleased");
        }
        Text{
            id: info
            anchors.centerIn: parent
            text: ""
        }

        //底部
        BottomGesture{
            width: parent.width
            height: root.areaWidth
            anchors.bottom: parent.bottom

            onHomeTriggered: {
                info.text = "HOME"
            }
            onMultitaskTriggered: {
                info.text = "TASK"
            }
            onPressed: info.text = ""
        }

        BackGesture{
            width: root.areaWidth
            height: parent.height

            onPressed: info.text = ""
            onBackTriggered: {
                info.text = "BACK"
            }
        }

        BackGesture{
            width: root.areaWidth
            height: parent.height
            anchors.right: parent.right
            startX: width
            endX: 0

            onPressed: info.text = ""
            onBackTriggered: {
                info.text = "BACK"
            }
        }


    }

}
